import type { RouteRecordRaw } from 'vue-router'

export const dynamicRoutes: RouteRecordRaw[] = [
  {
    path: '/home',
    name: 'home',
    component: () => import('/@/views/home/index.vue'),
    meta: {
      title: 'Home',
      isHide: false,
      isKeepAlive: true,
      icon: '',
      isDynamic: false,
      isAffix: true
    }
  },
  {
    path: '/system',
    name: 'system',
    component: () => import('/@/layout/routerView/parent.vue'),
    meta: {
      title: 'System',
      isLink: '',
      isHide: false,
      isKeepAlive: true,
      isAffix: false,
      isIframe: false,
      roles: ['admin'],
      icon: '',
      isDynamic: true,
      isDynamicPath: '/system',
    },
    children: [
      {
        path: '/system/test',
        name: 'Test',
        component: () => import('/@/views/test/index.vue'),
        meta: {
          title: 'Test',
          isLink: false,
          isHide: false,
          isKeepAlive: true,
          isAffix: false,
          isIframe: false,
          roles: ['admin'],
          isDynamic: true,
          isDynamicPath: '/system/test',
          icon: ''
        }
      },
      {
        path: '/system/user',
        name: 'User',
        component: () => import('/@/views/user/index.vue'),
        meta: {
          title: 'User',
          isLink: false,
          isHide: false,
          isKeepAlive: true,
          isAffix: false,
          isDynamic: true,
          isIframe: false,
          roles: ['admin'],
          isDynamicPath: '/system/user',
          icon: ''
        }
      }
    ]
  }
]

export const routes: RouteRecordRaw[] = [
    {
      path: '/',
      name: '/',
      component: () => import('/@/layout/index.vue'),
      redirect: '/home',
      meta: { isKeepAlive: true },
      children: [
        {
          path: '/home',
          name: 'home',
          component: () => import('/@/views/home/index.vue'),
          meta: {
            title: 'Home',
            isHide: false,
            isKeepAlive: true,
            icon: ''
          }
        },
        // ...dynamicRoutes,
        {
          path: '/system',
          name: 'system',
          component: () => import('/@/layout/routerView/parent.vue'),
          redirect: '/system/test',
          meta: {
            title: 'System',
            isLink: '',
            isHide: false,
            isKeepAlive: true,
            isAffix: false,
            isIframe: false,
            roles: ['admin'],
            icon: '',
          },
          children: [
            {
              path: '/system/test',
              name: 'Test',
              component: () => import('/@/views/test/index.vue'),
              meta: {
                title: 'Test',
                isLink: false,
                isHide: false,
                isKeepAlive: true,
                isAffix: false,
                isIframe: false,
                roles: ['admin'],
                isDynamic: true,
                isDynamicPath: '/system/test',
                icon: ''
              }
            },
            {
              path: '/system/user',
              name: 'User',
              component: () => import('/@/views/user/index.vue'),
              meta: {
                title: 'User',
                isLink: false,
                isHide: false,
                isKeepAlive: true,
                isAffix: false,
                isDynamic: true,
                isIframe: false,
                roles: ['admin'],
                isDynamicPath: '/system/user',
                icon: ''
              }
            }
          ]
        }
      ]
    },
    {
      path: '/login',
      component: () => import('/@/views/login/index.vue')
    }
]
